﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.VisualStudio.Modeling;

namespace DSLFactory.VSCTDesigner
{
    partial class IDNameProvider : ElementNameProvider
    {
        protected override void SetUniqueNameCore(ModelElement element, string baseName, IDictionary<string, ModelElement> siblingNames)
        {
            if( element is Group )
                baseName = "grpidGroup";
            else if( element is Menu )
                baseName = "menuidMenu";
            else if( element is Button )
                baseName = "cmdId";
            else if( element is Combo )
                baseName = "cmdComboId";
            else if( element is ExternCommand )
                this.DomainProperty.SetValue(element, String.Empty); // force à blanc pour obliger la saisie

            base.SetUniqueNameCore(element, baseName, siblingNames);
        }

    }
}
